﻿using Microsoft.AspNetCore.Mvc;

namespace WebApi.Controllers
{
    [Route("[controller]")]
    [ApiController]
    [ApiExplorerSettings(GroupName = nameof(ApiVersions.V1))]
    public class LogController : ControllerBase
    {
        private readonly ILogger<LogController> _logger;

        public LogController(ILogger<LogController> logger)
        {
            _logger = logger;
        }

        [HttpGet]
        [Route("info")]
        public void Info()
        {
            _logger.LogInformation("Info log");
        }

        [HttpGet]
        [Route("debug")]
        public void Debug()
        {
            _logger.LogDebug("Debug log");
        }

        [HttpGet]
        [Route("warn")]
        public void Warning()
        {
            _logger.LogWarning("Warning log!");
        }

        [HttpGet]
        [Route("error")]
        public void Error()
        {
            _logger.LogError("Error log!");
        }
    }
}
